NOTE: This Technical Note has been retired. Please see the Technical Notes page for current documentation.

Technical Note TB05
Custom WDEF and wDraw

CONTENTS

This Technical Note explains why custom window definition functions may not respond to a wDraw message from the system (if you follow the documentation in Inside Macintosh).

[Feb 01 1991]






Problem & Solution

Inside Macintosh, Volume I-299, documents the declaration of the window definition function (WDEF) as follows:

    FUNCTION MyWindow(varCode: INTEGER; theWindow: WindowPtr; message:

On the first examination of the parameters, one may assume param always contains a long value; however, when the system is calling the WDEF with message = wDraw, it only stores a short value in param without clearing the high-order word of param. If the high-order word contains any value other than zero, the content of param is different from what the WDEF expects.

For the custom WDEF to work correctly, it should use only the low-order word of param when message = wDraw.


Note:
This problem exists in all systems up to and including System Software 7.0. The suggested fix is valid for all of these systems.


Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (40K).

Download



Developer Documentation | Technical Q&As | Development Kits | Sample Code